package com.gitee.wsl.mathematics.interpolator.ext

import com.gitee.wsl.ext.number.isFuzzyEqual
import com.gitee.wsl.mathematics.interpolator.PercentOrRatio
import com.gitee.wsl.mathematics.interpolator.Ratio

fun PercentOrRatio.isAlmostEquals(that: PercentOrRatio, epsilon: PercentOrRatio = Ratio(0.000001)): Boolean = this.value.isFuzzyEqual(that.value, epsilon.value)
fun PercentOrRatio.isAlmostZero(epsilon: PercentOrRatio = Ratio(0.000001)): Boolean = this.isAlmostEquals(Ratio.ZERO, epsilon)
